package com.zjx.shop.common.utils;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 郑家莽
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class R {

    private boolean success;

    private Integer code;

    private String msg;

    private Object data;

    public static R ok() {
        return new R(true,200,"success",null);
    }
    public static R ok(Object data) {
        return new R(true,200,"success",data);
    }
    public static R error(Integer code, String msg) {
        return new R(false,code,msg,null);
    }
    public static R error(Integer code, String msg,Object data) {
        return new R(false,code,msg,data);
    }
}
